<?php
require_once 'BaseMySQLDAO.php';

class UserDAO extends BaseMySQLDAO {

    public function __construct($context) {
        parent::__construct($context, 'user');
    }

	public function login($uid, $pass) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction();

            $inSQL = "SELECT * FROM user WHERE uid = :uid AND pass = :pass "; 
            $param = array(":uid" => $uid, ":pass" => $pass);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }

}
?>